using System;

namespace QUAN_LY_NGAN_HANG_CAU_HOI_TRAC_NGHIEM
{
    public class DangNhapPrensenter
    {
        private IDangNhap view;

        private TaiKhoanDAL tk = new TaiKhoanDAL()
                                     {GiaoVien = Guid.Empty, Password = "admin", Quyen = Guid.Empty, Username = "admin"};

        public  TaiKhoanDAL TaiKhoan
        {
            get { return tk;}   
        }

        public void Init(IDangNhap v)
        {
            view = v;
        }

        public bool CheckUserPas(string usr, string pass)
        {
            if (usr == "admin" && pass == "admin")
            {
                return true;
            }
            else
            {
                tk = TaiKhoanDAL.LayTaiKhoan_UserName(usr);
                if (pass == tk.Password)
                {
                    return true;
                }
            }
            return false;
        }
    }
}